<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
        }
        .feater{
            margin: 100px auto;
            width: 340px;
            height: 30px;
            border-radius: 10px;
            background: url(./image/bg.jpg);
        }
        .feater>li{
            float: left;
            width: 100px;
            text-align: center;
            margin-left: 10px;
            line-height: 30px;
            
            background: url(./image/libg.jpg);
        }
        .son{
            display: none;
        }
        .son>li{
            background: url(./image/libg.jpg);
        }
    </style>
</head>
<body>
    <ul class="feater">
        <li>一级菜单
            <ul class="son">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>一级菜单
            <ul class="son">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
        <li>一级菜单
            <ul class="son">
                <li>二级菜单</li>
                <li>二级菜单</li>
                <li>二级菜单</li>
            </ul>
        </li>
    </ul>
</body>
</html>
<script>
    var ils = document.querySelectorAll('.feater>li')
    var son = document.querySelectorAll('.son')

    ils.forEach((item,index)=>{
        item.onmouseover = function(){
            son[index].style.display = 'block'
        }
        item.onmouseout = function(){
            son[index].style.display = 'none'
        }
    })
</script>